{template Public:Page:header}
<form method="post" id="SubmitForm">

<div class="container">
  <div class="row">
  
    {template Member:Index:sidebar}
    
    <div class="col-lg-10 well-col-pl-30">
      <div class="row">
            <div class="well">

                <h3>服务管理</h3>
                
                <div class="alert alert-info fade in">
                    <button data-dismiss="alert" class="close">
                        ×
                    </button>
                    <i class="fa-fw fa fa-info"></i>
                    <strong>提示</strong> 设置推荐为在本店铺推荐服务
                </div>
                
               <table class="table table-striped table-bordered table-hover">
                <thead>
                    <tr>
                     <th style="width:38px">
                        <div class="checkbox" style="padding:0px; margin:0px;">
                          <label style="padding:0px;">
                            <input type="checkbox" id="CheckAll" style="display:none">
                            <span class="text"></span></label>
                        </div>
                         </th>
                        <th>
                        	 ID
                        </th>
                        <th>
                        	 标题
                        </th>
                        <th>
                            发布时间
                        </th>
                        <th>
                           出售价格
                        </th>
                        <th>
                           本店推荐
                        </th>
                         <th>
                         状态
                        </th>
                        <th>
                        操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                
                	{if !empty($list)}
                        {foreach $list $value}
                            <tr>
                           		<td style="width:38px"> <div class="checkbox" style="padding:0px; margin:0px;">
                                    <label style="padding:0px;">
                                      <input type="checkbox" name="checkbox[]" value="{echo $value['id']}" style="display:none">
                                      <span class="text checkbox"></span></label>
                                  </div>
                                </td>
                           		<td>
                                    {echo $value['id']}
                                </td>
                                
                                <td>
                                 <div class="row">
                                    {if $value['picture']}
                                    <div class="col-lg-3">
                                    	<a href="/shop/fuwu/{echo $value['id']}" target="_blank"><img src="/{echo $value['picture']}" style="height:80px;"/></a>
                                    </div>
                                    {/if}
                                    <div class="col-lg-9" style="padding-top:16px;padding-left:20px;">
                                    <h5><a href="/shop/fuwu/{echo $value['id']}" target="_blank">{echo $value['subject']}</a></h5>
                                    <p>
                                    {echo $value['description']}
                                    </p>
                                    </div>
                                 </div>   
                                </td>
                                
                                <td>
                                   {echo FormatDate("Y/m/d",$value['dateline'])}
                                </td>
                                <td>
                                    <span class="color_f60">￥{echo $value['money']}</span>
                              </td>
                                <td>
                                   {if $value['mytop']==1}<span class="label label-success">推荐</span>{/if}
                              </td>
                                <td>
                                   {if $value['process']==0}未审核{elseif $value['process']==4}<span class="text-success">审核成功</span>{else}审核失败{/if}
                              </td>
                                <td>
                                <a href="/fuwu/publish/index/id/{echo $value['id']}" target="_blank" class="btn btn-default btn-xs">编辑</a>
                                </td>
                            </tr>
                        {/foreach}
                    {/if}
                    
                </tbody>
            </table>
            
            {if $page}
            <p>
            <div class="dataTables_paginate paging_bootstrap text-right"><ul class="pagination">{echo $page}</ul></div>
            </p>
            {/if}    
            
            <p>
            <a class="btn btn-azure btn-sm" href="javascript:void(0);" onclick="FuwuConfirm(1)">设置推荐</a> <a class="btn btn-azure btn-sm" href="javascript:void(0);" onclick="FuwuConfirm(2)">取消推荐</a> <a class="btn btn-darkorange btn-sm" href="javascript:void(0);" onclick="FuwuConfirm(3)">删除</a>
            </p>

            
            </div>
    </div>
  </div>
</div>
</div>
</form>

<script>

function FuwuConfirm(type){
	var url='/post/fuwu/settop';
	var mytop=0;
	if(type==1){
		var message='是否设置推荐?';
		mytop=1;
	}else if(type==2){
		var message='是否取消推荐?';
		mytop=2;
	}else if(type==3){
		var message='是否删除服务?';
		url='/post/fuwu/delete';
	}

   bootbox.confirm({  
	buttons: {  
		confirm: {  
			label: '确定',  
			className: 'btn-success'  
		},  
		cancel: {  
			label: '取消',  
			className: 'btn-default'  
		}  
	},  
	message:  message,  
	callback: function(result) {  
		if(result) {  
			 bootbox.hideAll();
			 $.post(url,$("#SubmitForm").serialize()+'&mytop='+mytop, function(json) {
				
					$('.bootbox').PhpappProgress({json:json});

					return true;
				
			  }, 'json');
			  
			 bootbox.dialog({
				 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
				 title: '<i class="icon fa fa-retweet"></i> 提交中',
				 closeButton: false
			 }).PhpappProgress({time:1000});
		 
			  return false; 
			
		} 
	},  
	title: "服务操作",  
	});
	  
}

</script>
    
    
{template Public:Page:footer}